package com.itqf.service.impl;

import com.itqf.dao.UsersDao;
import com.itqf.service.UsersService;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2021/1/13
 * @Time: 上午9:54
 */
public class UsersServiceImpl implements UsersService {

    //依赖dao
    //UsersDao usersDao = new UserDaoImpl(); //耦合高  强耦合

    private UsersDao usersDao = null;//解耦

    public  UsersServiceImpl(){
        System.out.println("实例化：UsersServiceImpl.....");
    }

    public void setUsersDao(UsersDao usersDao) {
        System.out.println("调用setUsersDao方法赋值....... ");
        this.usersDao = usersDao;
    }

    @Override
    public void save() {
        usersDao.save();
    }

    @Override
    public void update() {
       usersDao.update();
    }
}
